local lixing = fk.CreateSkill {
  name = "lingling__lixing",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lingling__lixing"] = "厉行",
  [":lingling__lixing"] = "当你每回合首次对其他角色造成伤害后，若其手牌中有【闪】或【无懈可击】，你摸两张牌。",
}

lixing:addEffect(fk.Damage, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(lixing.name) and data.to ~= player and
      table.find(data.to:getCardIds("h"), function (id)
        return Fk:getCardById(id).trueName == "jink" or Fk:getCardById(id).trueName == "nullification"
      end) then
      local damage_events = player.room.logic:getActualDamageEvents(1, function(e)
        return e.data.from == player and e.data.to ~= player
      end, Player.HistoryTurn)
      return #damage_events == 1 and damage_events[1].data == data
    end
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(2, lixing.name)
  end,
})

return lixing
